public class Demo3 {
    public static void main(String[] args) {
        System.out.println(print(1234));
    }
    public static int print(int n) {
        if(n > 9) {
            print(n/10);
        }
        System.out.println(n % 10);
        return n;
    }
}
